md-dialog.newProjectDialog(aria-label="New project")
	md-toolbar
		.md-toolbar-tools
			h2 New Project
			span(flex)
			md-button.md-icon-button(ng-click="vm.closeDialog()")
				md-icon.angular-material-icons(aria-label="Close dialog") close
	md-content(layout-margin)
		div(layout="column")
			md-input-container
				input(placeholder="Project name", tdr-focus="true", ng-model="vm.newProjectData.name", ng-keypress="vm.saveNewProject($event)", ng-pattern="vm.projectRegExp" maxlength=20)
				.inputHint Letters, numbers, hyphen and underscore only
			
			md-input-container
				input(placeholder="Project Code (Optional)", ng-model="vm.newProjectData.code", maxlength=5)

			md-input-container
				label Project type
				md-select(ng-model="vm.newProjectData.type")
					md-option(ng-repeat="projectType in vm.projectTypes", value="{{projectType}}") {{projectType}}
			md-input-container(ng-if="vm.showProjectTypeOtherInput")
				input(placeholder="Other project type", ng-model="vm.newProjectData.otherType")


			md-input-container
				label Unit
				md-select(ng-model="vm.newProjectData.unit")
					md-option(ng-repeat="unit in vm.units", value="{{unit.value}}") {{unit.name}}


			md-input-container(ng-if="vm.newProjectFileToUpload")
				input(placeholder="Revision name (optional)", ng-model="vm.tag")
				.inputHint Letters, numbers and underscore only

			md-input-container(ng-if="vm.newProjectFileToUpload")
				textarea(placeholder="Revision description (optional)", ng-model="vm.desc")

			md-input-container
				md-button.md-accent(ng-click="vm.uploadFileForNewProject()") Upload File
				md-button.md-raised.md-accent(ng-disabled="vm.newProjectButtonDisabled", ng-click="vm.saveNewProject()") Save
			#projectDialogFilenameContainer(layout="row", ng-if="vm.newProjectFileToUpload")
				p#projectDialogFilenameIntro Selected file
				p#projectDialogFilename {{vm.newProjectFileToUpload.name}}
			p#projectDialogError(ng-if="vm.showNewProjectErrorMessage") {{vm.newProjectErrorMessage}}
